var app = angular.module('app', []);
app.controller('formCtrl', ['$scope', '$http', function($scope, $http) {
    $scope.submit = function() {
        $http({
            method: 'POST',
            params: {
                deviceTypeCode: $scope.sheb.deviceTypeCode, //设备类型编码
                model: $scope.sheb.model, //规格型号
                useLocationCode: $scope.sheb.useLocationCode, //使用部位编码
                catgegroy: $scope.sheb.catgegroy, //设备分类
                isRent: $scope.sheb.isRent, //租赁标识
                inTime: $scope.sheb.inTime, //进场时间
                acceptStatus: $scope.sheb.acceptStatus, //验收状态
                remark: $scope.sheb.remark //备注
            },
            url: 'http://192.168.1.200:8080/sgms/api/v1/device/add',
        }).then(function successCallback(res) {
            console.log(res.data);

        }, function errorCallback(response) {
            console.log('错误');
        });
    };



    // $http({
    //      method: 'POST',
    //      params: {

    //      },
    //      url: 'http://192.168.1.200:8081/api/v1/device/add',
    //  }).then(function successCallback(res) {
    //      $scope.info = res.data;
    //      console.log($scope.info);
    //  }, function errorCallback(response) {
    //      console.log('错误');
    //  });

    //  $http.post('http://192.168.1.200:8080/sgms/api/v1/device/add').then(function (res) {
    //      $scope.info = res.data.data;
    //      console.log($scope.info);
    //      // $scope.cid = res.data.data.id;
    //      // $scope.fa = res.data.hasCol;
    //      // console.log($scope.fa);
    //  }, function errorCallback(response) {
    //      console.log('错误');
    //  });
}]);
